package org.jkuang.qstar.commons.jni;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;



public class SMampTest {

	static void test1() throws InterruptedException {
	    DicMap sMap = new DicMap(16);
        Map<Integer,String> map = new HashMap<>();
        Random random = new Random();
        
    
    	
        for (int i = 0; i < 1024*1024*5; i++) {
        	String string=UUID.randomUUID().toString();
        	int result=sMap.put(string);
        	map.put(result,string);
		}
        System.out.println("ok---------------------1111");
     
        for (int i = 0; i < 1024*1024*5; i++) {
        	int value =random.nextInt(1024*1524);
        	if(map.containsKey(value)) {
              	sMap.remove(map.get(value));
            	map.remove(value);
        	}

		}
        System.out.println("ok---------------------22222222");
        for (int i = 0; i < 1024*1024; i++) {
        	String string=UUID.randomUUID().toString();
        	int result=sMap.put(string);
        	
		}
 
        for (int key:map.keySet()) {
			String string = map.get(key);
			if(key!=(sMap.get(string))) {
				System.out.println("xxxxxxxxxxx");
				System.exit(0);
			}
		}
        
        
        System.out.println("OK----------------------"+sMap.maxSeq());
        Thread.sleep(1000000);
       System.out.println("OK----------------------");
	}
	
	public static void main(String[] args) throws InterruptedException {
		// TODO Auto-generated method stub
        test1();
	}

}
